package com.deluxelx.soul.inn.service.file.impl;

import com.deluxelx.soul.inn.bean.file.FileUploadParam;
import com.deluxelx.soul.inn.service.file.FileService;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import static com.deluxelx.soul.inn.service.file.FileStrategyConfig.fileStrategyMap;

/**
 * 文件操作实现类
 *
 * @author liaozihao
 * @date 2024-04-30 8:55
 */
@Service
public class FileServiceImpl implements FileService {

    @Override
    public Boolean upload(MultipartFile file, FileUploadParam param) {
        return fileStrategyMap.get(param.getFileType()).upload(file, param.getPrimaryId());
    }
}
